package com.project.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 商品订单
 * @author 
 */
@Data
@TableName(value = "cms_order")
@Table(name = "cms_order", comment = "商品订单")
public class CmsOrder implements Serializable {
    /**
     * 订单ID
     */
    @TableId
    @Column(type= MySqlTypeConstant.BIGINT, comment = "订单ID", length = 11, isKey = true, isAutoIncrement = true,isNull = false)
    private Long productOrderId;

    /**
     * 用户ID
     */
    @Column(comment = "用户ID")
    private Long userId;

    /**
     * 订单号
     */
    @Column(comment = "订单号")
    private String orderNumber;

    /**
     * 购买总数
     */
    @Column(comment = "购买总数")
    private Integer quantity;

    /**
     * 订单总金额
     */
    @Column(comment = "订单总金额", defaultValue = "0.00", type = MySqlTypeConstant.DECIMAL, length = 18, decimalLength = 2)
    private BigDecimal totalAmount;

    /**
     * 是否使用余额（1:使用,2:不使用）
     */
    @Column(comment = "是否使用余额（1:使用,2:不使用）")
    private Integer useBalance;

    /**
     * 抵扣金额（余额抵扣）
     */
    @Column(comment = "抵扣金额（余额抵扣）", defaultValue = "0.00", type = MySqlTypeConstant.DECIMAL, length = 18, decimalLength = 2)
    private BigDecimal deductionAmount;

    /**
     * 收货人名称
     */
    @Column(comment = "收货人名称")
    private String receiveName;

    /**
     * 收货人联系方式
     */
    @Column(comment = "收货人联系方式")
    private String receiveMobile;

    /**
     * 收货地址
     */
    @Column(comment = "收货地址")
    private String receiveAddress;

    /**
     * 支付单号
     */
    @Column(comment = "支付单号")
    private String tradeNo;

    /**
     * 支付金额
     */
    @Column(comment = "支付金额", defaultValue = "0.00", type = MySqlTypeConstant.DECIMAL, length = 18, decimalLength = 2)
    private BigDecimal payAmount;

    /**
     * 系统退款单号
     */
    @Column(comment = "系统退款单号")
    private String refundNo;

    /**
     * 退款金额
     */
    @Column(comment = "退款金额", defaultValue = "0.00", type = MySqlTypeConstant.DECIMAL, length = 18, decimalLength = 2)
    private BigDecimal refundAmount;

    /**
     * 退款说明
     */
    @Column(comment = "退款说明")
    private String reasons;

    /**
     * 退款附言
     */
    @Column(comment = "退款附言")
    private String reasonsPostscript;

    /**
     * 发货物流单号
     */
    @Column(comment = "发货物流单号")
    private String logisticsNumber;

    /**
     * 物流公司名称
     */
    @Column(comment = "物流公司名称")
    private String logisticsCompany;

    /**
     * 物流公司代码
     */
    @Column(comment = "物流公司代码")
    private String logisticsCompanyCode;

    /**
     * 物流公司图标
     */
    @Column(comment = "物流公司图标")
    private String logisticsCompanyImg;

    /**
     * 是否需要发票（0:不需要,1:需要）
     */
    @Column(comment = "是否需要发票（0:不需要,1:需要）", defaultValue = "0")
    private Integer invoiceRequired;

    /**
     * 下单时间
     */
    @Column(comment = "下单时间", type = MySqlTypeConstant.DATETIME)
    private Date createTime;

    /**
     * 最晚支付时间
     */
    @Column(comment = "最晚支付时间", type = MySqlTypeConstant.DATETIME)
    private Date deadlineTime;

    /**
     * 取消时间
     */
    @Column(comment = "取消时间", type = MySqlTypeConstant.DATETIME)
    private Date closeTime;

    /**
     * 支付时间
     */
    @Column(comment = "支付时间", type = MySqlTypeConstant.DATETIME)
    private Date payTime;

    /**
     * 发货时间
     */
    @Column(comment = "发货时间", type = MySqlTypeConstant.DATETIME)
    private Date sendTime;

    /**
     * 收货时间
     */
    @Column(comment = "收货时间", type = MySqlTypeConstant.DATETIME)
    private Date receiveTime;

    /**
     * 完成时间
     */
    @Column(comment = "完成时间", type = MySqlTypeConstant.DATETIME)
    private Date completeTime;

    /**
     * 申请退款时间
     */
    @Column(comment = "申请退款时间", type = MySqlTypeConstant.DATETIME)
    private Date applyRefundTime;

    /**
     * 退款成功时间
     */
    @Column(comment = "退款成功时间", type = MySqlTypeConstant.DATETIME)
    private Date successTime;

    /**
     * 退款失败时间
     */
    @Column(comment = "退款失败时间", type = MySqlTypeConstant.DATETIME)
    private Date failTime;

    /**
     * 订单备注
     */
    @Column(comment = "订单备注")
    private String remarks;

    /**
     * 订单状态（-1:已取消、0:待付款、1:待发货、2:待收货、3:待评价、4:已完成,5:退款中、6:退款成功、7:退款失败）
     */
    @Column(comment = "订单状态（-1:已取消、0:待付款、1:待发货、2:待收货、3:待评价、4:已完成,5:退款中、6:退款成功、7:退款失败）", defaultValue = "0")
    private Integer state;

    /**
     * 删除标志（-1:删除,1:正常）
     */
     @Column(comment = "删除标志（-1:删除,1:正常）", defaultValue = "1")
    private Integer status;

    private static final long serialVersionUID = 1L;

}